package com.woniu;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

public class AotuMPAdminApp {

    public static void main(String[] args) {

        FastAutoGenerator.create(
                        //编写 url username password ，使生成器可以连接数据库读取相关信息
                        "jdbc:mysql://120.24.36.39:3306/alihealthy",
                        "root",
                        "123456")

                // 全局配置
                .globalConfig(builder -> {
                    builder.author("lwh") // 设置作者
                            .outputDir("/Users/nenxiangjiao/Desktop/JAVA课程/aliHealthy/src/main/java"); // 指定输出目录
                })
                // 包配置
                .packageConfig(builder -> {
                    builder.parent("com.woniu.admin") // 设置父包名
                            .controller("controller")
                            .service("service")
                            .serviceImpl("service.impl")
                            .mapper("mapper")
                            .xml("adminMapper")
                            .entity("bean");
                })
                //表的配置  3
                .strategyConfig(builder -> {
                    builder.addInclude("authority").addInclude("management").addInclude("position");
                    /*
                    builder.addInclude("address").addInclude("advertising").addInclude("aftermarket").addInclude("aftermarket_type")
                            .addInclude("appraise").addInclude("authority").addInclude("blood").addInclude("blood_glucose")
                            .addInclude("brand").addInclude("brand_region").addInclude("comments").addInclude("complain")
                            .addInclude("coupons").addInclude("dynamic").addInclude("examine").addInclude("express")
                            .addInclude("express_template").addInclude("express_to_address").addInclude("fans").addInclude("hat_area")
                            .addInclude("hat_city").addInclude("hat_province").addInclude("heart").addInclude("infomation")
                            .addInclude("infomation_type").addInclude("management").addInclude("order_to_product").addInclude("position")
                            .addInclude("product").addInclude("product_type").addInclude("purchase").addInclude("sleep")
                            .addInclude("sport").addInclude("subclass").addInclude("temperature").addInclude("type_to_subclass")
                            .addInclude("walk").addInclude("weight"); // 设置需要生成的表名

                     */
                })
                // 使用Freemarker引擎模板，默认的是Velocity引擎模板
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
        System.out.println("成功了...");
    }

}